GXGetPathParts
You can use theGXGetPathParts
function to extract a copy of a specified range of geometric points from the geometry of a path shape and put these points into agxPaths
structure.
long GXGetPathParts(gxShape source, long index, long count, gxPaths *data);
source
- A reference to the path shape containing the desired geometric points.
index
- The geometry index of the first geometric point to copy.
count
- The number of geometric points to copy. You may provide the
gxSelectToEnd
constant for this parameter.data
- A pointer to a
gxPaths
structure. On return, this structure contains the copied geometric information.- function result
- The number of bytes required to hold the information returned in the
data
parameter.DESCRIPTION
TheGXGetPathParts
function copies geometry information from the source path shape into thegxPaths
structure specified by thedata
parameter. This function copies all of the geometry information starting with the geometric point indicated by theindex
parameter and continuing for as many geometric points as indicated by thecount
parameter. This function copies the values of the indicated geometric points and retains the information about contour breaks from the original geometry, as well as the information about which points are on curve and which are off curve. The function result is the length in bytes of the information returned in thedata
parameter.Both the
index
and thecount
parameters must be greater than 0, although you can provide thegxSelectToEnd
constant for thecount
parameter, which indicates that you want a copy of all the geometric points starting with the geometric point indicated by theindex
parameter.You may pass
nil
for thedata
parameter. In this case, the function still returns the byte length as the function result, but does not copy any geometry information.Typically, to use this function, you go through these steps:
- Determine the byte length needed to store the copied geometry information by calling this function, passing
nil
for thedata
parameter.- Allocate enough memory to hold the copied geometry information.
- Call this function again, passing a pointer to the allocated memory in the
data
parameter.
ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory shape_is_nil illegal_type_for_shape (debugging version) index_is_less_than_one (debugging version) count_is_less_than_one (debugging version) Warnings index_out_of_range count_out_of_range SEE ALSO
For a discussion of paths, see "Path Shapes" on page 2-25.For the definition of the
gxPaths
structure, see page 2-107.For information about other functions that allow you to extract information from shape geometries, see the description of the
GXGetShapePoints
function on page 2-140 and the description of theGXGetShapeParts
function on page 2-152.To replace parts of a path shape's geometry, use the
GXSetPathParts
function, which is described in the next section.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help